﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="company.aspx.cs" Inherits="Torch.WL.Web.CleanChina.company" %>

<%@ Register Src="~/UserControl/WebPager.ascx" TagName="Pager" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>展商管理</title>
    <link rel="stylesheet" href="..\resources\css\style.css" />
    <link rel="stylesheet" href="..\resources\css\smoothness\jquery-ui-1.9.0.custom.min.css" />
    <script type="text/javascript" src="..\resources\Js\jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="..\resources\Js\jquery-ui-1.9.0.custom.min.js"></script>
    <script type="text/javascript" src="../DatePicker/WdatePicker.js"></script>
</head>
<body class="bodyDetail">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div class="mainbody">
        <div class="headerIframe">
            <div class="pathIframe">
                展会管理 > 展商管理
            </div>
            <div class="returnIframe">
                &nbsp;
            </div>
            <div class="titleIframe">
                &nbsp;
            </div>
            <div class="controlIframe">
                <span class="buttons">
                    <asp:LinkButton runat="server" ID="lbtnAddZs" OnClientClick="Tjzs(1);return false;"
                        CssClass="positive" Style="float: right;"> <img src="..\resources\images\001_01.png" alt="" />
                    &nbsp;添&nbsp;&nbsp;加 &nbsp;&nbsp;</asp:LinkButton>
                </span>
            </div>
        </div>
        <div class="searchPaneIframe">
            <span class="searchPartIframe">公司名称 ：<asp:TextBox runat="server" ID="txtGsmc" CssClass="normal noinfo"
                MaxLength="100" ValidationGroup="Search" onblur="TextCss(this)"></asp:TextBox>
            </span>
            <asp:ImageButton runat="server" ID="ibtnSearch" ImageUrl="..\resources\images\search.png"
                CssClass="searchBtnIframe" OnClick="lbtnSearch_Click" />
        </div>
        <div class="clear">
        </div>
        <div class="contentDetail">
            <div class="levelOneLine">
            </div>
            <div class="levelOneContent" style="height: 320px;">
                <span class="levelOneAll">
                    <asp:UpdatePanel runat="server" ID="upGsList" UpdateMode="Conditional" ChildrenAsTriggers="true">
                        <ContentTemplate>
                            <table style="margin: 3px auto;">
                                <thead>
                                    <tr>
                                        <td style="width: 120px;">
                                            公司Logo
                                        </td>
                                        <td style="width: 80px;">
                                            展位号
                                        </td>
                                        <td style="width: 100px;">
                                            公司名
                                        </td>
                                        <td style="width: 80px;">
                                            电话
                                        </td>
                                        <td>
                                            简介
                                        </td>
                                        <td style="width: 54px;" colspan="2">
                                            操作
                                        </td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <asp:Repeater ID="rptZs" runat="server" OnItemCommand="rptZs_ItemCommand">
                                        <ItemTemplate>
                                            <tr>
                                                <td style="text-align: center;">
                                                    <%#Eval("Gslogo")%>
                                                </td>
                                                <td style="text-align: left;">
                                                    <%#Eval("ZhanWeiH")%>
                                                </td>
                                                <td style="text-align: left;">
                                                    <%#Eval("companyName")%>
                                                </td>
                                                <td style="text-align: left;">
                                                    <%#Eval("companyTele")%>
                                                </td>
                                                <td style="text-align: left;">
                                                    <%#Eval("companyMemo")%>
                                                </td>
                                                <td style="width: 27px;">
                                                    <asp:ImageButton ID="ibtnEdit" ToolTip="编辑" runat="server" ImageUrl="..\resources\images\file_edit.png"
                                                        CommandArgument='<%#Eval("companyId") %>' CommandName="Edit" />
                                                </td>
                                                <td style="width: 27px;">
                                                    <asp:ImageButton ID="ibtnDelete" ToolTip="删除" runat="server" ImageUrl="..\resources\images\document_delete.png"
                                                        CommandArgument='<%#Eval("companyId") %>' CommandName="Delete" OnClientClick="return confirm('确定删除吗?');" />
                                                </td>
                                            </tr>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                            <div style="margin: 3px auto;">
                                <uc:Pager ID="pgList" runat="server" OnPreRender="pgList_OnPreRender" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </span>
            </div>
        </div>
    </div>
    <div id="Zs_dialog" title="展商" style="display: none;">
        <asp:UpdatePanel runat="server" ID="upZsDetail" UpdateMode="Conditional" ChildrenAsTriggers="true">
            <ContentTemplate>
                <div class="pageDetail" style="width: 620px;">
                    <div class="clear">
                    </div>
                    <div class="contentDetail">
                        <div class="levelOneContent">
                            <span class="levelOneLeftTitle">公司Logo </span><span class="levelOneRight">
                                <asp:FileUpload ID="fuGslogo" runat="server" Style="width: 70%;" /><asp:Literal runat="server"
                                    ID="ltGslogo"></asp:Literal>
                            </span>
                        </div>
                        <div class="levelOneContent">
                            <span class="levelOneLeftTitle">展位号</span> <span class="levelOneRight">
                                <asp:TextBox runat="server" ID="txt_Zs_Zwh" MaxLength="100" CssClass="normal" Style="width: 70%;"
                                    onblur="TextCss(this)"></asp:TextBox></span>
                        </div>
                        <div class="levelOneContent">
                            <span class="levelOneLeftTitle">公司名</span> <span class="levelOneRight">
                                <asp:TextBox runat="server" ID="txt_Zs_Gsm" MaxLength="100" CssClass="normal" Style="width: 70%;"
                                    onblur="TextCss(this)"></asp:TextBox></span>
                        </div>
                        <div class="levelOneContent">
                            <span class="levelOneLeftTitle">电话</span> <span class="levelOneRight">
                                <asp:TextBox runat="server" ID="txt_Zs_Dh" MaxLength="100" CssClass="normal" Style="width: 70%;"
                                    onblur="TextCss(this)"></asp:TextBox></span>
                        </div>
                        <div class="levelOneContent">
                            <span class="levelOneLeftTitle">主营产品</span> <span class="levelOneRight">
                                <asp:TextBox runat="server" ID="txt_Zs_Zycp" MaxLength="100" CssClass="normal" Style="width: 70%;"
                                    onblur="TextCss(this)"></asp:TextBox></span>
                        </div>
                        <div class="levelOneContentFCK">
                            <span class="levelOneLeftTitle">简介<br />
                                (限500字)</span> <span class="levelOneRight">
                                    <asp:TextBox runat="server" ID="txt_Zs_Jj" CssClass="normal" Style="width: 70%;"
                                        Rows="5" TextMode="MultiLine"></asp:TextBox>
                                </span>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div class="footerDetail">
                        <div class="footerDetailContent">
                            <span class="buttons">
                                <asp:LinkButton runat="server" ID="lbtnSaveZs" OnClick="lbtnSaveZs_Click" CssClass="positive"
                                    Style="float: right;"> <img src="..\resources\Images\apply2.png" alt="" />
                    &nbsp;保&nbsp;&nbsp;存 &nbsp;&nbsp;</asp:LinkButton>
                            </span>
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                </div>
                <asp:HiddenField runat="server" ID="hfGsId" Value="" />
            </ContentTemplate>
            <Triggers>
                <asp:PostBackTrigger ControlID="lbtnSaveZs" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
<script>
    function Tjzs(operateType) {
        $("#Zs_dialog").dialog({
            resizable: false,
            width: 660,
            height: 450,
            modal: true
        });

        if (operateType == 1) {
            $("#<%=ltGslogo.ClientID %>").val('');
            $("#<%=txt_Zs_Zwh.ClientID %>").val('');
            $("#<%=txt_Zs_Gsm.ClientID %>").val('');
            $("#<%=txt_Zs_Dh.ClientID %>").val('');
            $("#<%=txt_Zs_Zycp.ClientID %>").val('');
            $("#<%=txt_Zs_Jj.ClientID %>").val('');
            $("#<%=hfGsId.ClientID %>").val('');
        }
    }

    //表格 用于单偶行显示区分
    function tablecss(tableObjId) {
        var tables = document.getElementsByTagName("table");
        if (typeof tableObjId != 'object' && tableObjId != undefined && tableObjId != '') {
            tables = new Array();
            tables[0] = $("#" + tableObjId)[0];
        }

        for (var x = 0; x != tables.length; x++) {
            var table = tables[x];
            if (!table) { return; }
            if (table.id == 'ToolBar') { return; }

            var tbodies = table.getElementsByTagName("tbody");

            for (var h = 0; h < tbodies.length; h++) {
                var even = true;
                var trs = tbodies[h].getElementsByTagName("tr");

                for (var i = 0; i < trs.length; i++) {
                    trs[i].onmouseover = function () {
                        this.className += " ruled"; return false
                    }
                    trs[i].onmouseout = function () {
                        this.className = this.className.replace("ruled", ""); return false
                    }

                    if (even)
                        trs[i].className += " even";

                    even = !even;
                }
            }
        }
    }

    window.onload = tablecss;
</script>
